package com.example.demo.service;

import com.example.demo.bean.SearchUserByCondition;
import com.example.demo.bean.UserInfo;
import com.example.demo.mapper.UserInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public void addUserInfo(String username, String type) {
        userInfoMapper.addUserInfo(username, type);
    }

    @Override
    public void updateUserInfo(UserInfo userInfo) {
        userInfoMapper.updateUserInfo(userInfo);
    }

    @Override
    public UserInfo getUserInfoByUsername(String username) {
        return userInfoMapper.getUserInfoByUsername(username);
    }

    @Override
    public List<UserInfo> getAllUserInfo() {
        return userInfoMapper.getAllUserInfo();
    }

    @Override
    public List<UserInfo> getUserInfoByCondition(SearchUserByCondition searchUserByCondition) {
        return userInfoMapper.getUserInfoByCondition(searchUserByCondition);
    }
}
